<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@page import="java.net.URLDecoder"%>
<%@ page import="com.sz.common.SZUtility" %>
<%@page import="com.sz.business.dao.IBusinessDAO"%>

<%

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";


String style1 = "width: 100px;text-align:right;font-size: 12px;";
String style2 = "width: 220px";
String input_text_gray = "width: 220px; color: gray";

String title = "";


String b_name = "";
String b_region_fullname = "";
String b_group_name = "";
String b_tel1 = "";
String b_address = "";
String business_id = "";

String ann_title = "";
String ann_content = "";
String ann_begin_time = "";
String ann_end_time = "";
String ann_state = "";


//模式 	mode_edit 或  mode_add


%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link href="<%= request.getContextPath() %>/css/main.css" rel="stylesheet" type="text/css" />
		<base href="<%=basePath%>" target="_self">
		<title><%=title%></title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="">
		<meta http-equiv="description" content="" >
	</head>
	
	<body onload="onload()">
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/calendar.js"></script>
		<script type="text/javascript" src="js/utility.js"></script>
		
		<table width="100%">
		  <tr>
		  	<td colspan="3" class="title0" >增加坐席公告</td>		  	
	  	  </tr>
	  	</table> 

	  	
	  	<form name="add_announce_business"  action="announce/addAnnounce.exec" method="post" onsubmit="return check()"> 
	  	<table id = "announce_business" width="100%" border="0" cellpadding="0" cellspacing="0" style="line-height:30px;">
	  		<tr>
	  			<th colspan="4" align="left">&nbsp;&nbsp;&nbsp;公告信息</th>
	  		</tr>
	  		<tr>
	  			<td style="<%=style1%>">公告标题&nbsp;&nbsp;&nbsp;</td>
	  			<td>
	  				<input type="text" id="ann_title" name="ann_title" value="<%=ann_title%>" style="<%=style2%>" >	  			
	  			</td>
	  			
	  			<td style="<%=style1%>">公告状态&nbsp;&nbsp;&nbsp;</td>
	  			<td >
	  				<div style="<%=style2%>">
	  				<input type="radio" id="ann_state_1" onclick="onClickRadio_state('1')">有效&nbsp;
	  				<input type="radio" id="ann_state_0" onclick="onClickRadio_state('0')">无效		  			
		  			</div>
	  			</td>	  			
	  		</tr>
	  		
	  		<tr>
	  			<td style="<%=style1%>">公告内容&nbsp;&nbsp;&nbsp;</td>
	  			<td colspan="3">
	  				<textarea id="ann_content" name="ann_content" style="width:300px; height:100px" ><%=ann_content%></textarea>	  			
	  			</td>
	  		</tr>
	  		
	  		<tr>
	  			<td style="<%=style1%>">开始时间&nbsp;&nbsp;&nbsp;</td>
	  			<td>
	  				<input type="text" id="ann_begin_time" name="ann_begin_time" value="<%=ann_begin_time%>" style="<%=style2%>" readonly="readonly" onclick="calendar.show(this)" >	  			
	  			</td>
	  			
	  			<td style="<%=style1%>">结束时间&nbsp;&nbsp;&nbsp;</td>
	  			<td>
	  				<input type="text" id="ann_end_time" name="ann_end_time" value="<%=ann_end_time%>" style="<%=style2%>" readonly="readonly" onclick="calendar.show(this)" >	  			
	  			</td>	  			
	  		</tr>
	  	</table>
	  	
	  	<input type = "hidden" id="business_id" name = "business_id" value="<%=business_id%>">
	  	<input type = "hidden" id="ann_state" name = "ann_state" >
	  	
	  	<input type = "hidden" id="ANNOUNCE_TYPE" name = "ANNOUNCE_TYPE" value="SEATING">
	  	<input type = "hidden" id="OPERATE_TYPE" name = "OPERATE_TYPE" value="ADD">
	  	
	  	<table width="100%" border="0" cellpadding="0" cellspacing="0" >
	  		<tr align="center">
	  			<td><input type="submit" value="提交"/></td>
	  		</tr>
		</table>
	  	</form>
	
		
	<SCRIPT LANGUAGE="JavaScript">	
	  	function onload() {

	  			document.getElementById("ann_state_1").checked = true;	  			
	  	
  		}
  		
		function onClickRadio_state(value) {
  			if(value == '0') {
 				document.getElementById("ann_state_0").checked = true;
 				document.getElementById("ann_state_1").checked = false;
 			} else {
 				document.getElementById("ann_state_1").checked = true;
 				document.getElementById("ann_state_0").checked = false; 				
 			} 
  		}
  		
  		function check() {
  		
  			var tmp;
			
  			tmp = document.getElementById("ann_title").value;
  			tmp = jQuery.trim(tmp);
  			if(tmp == "") {
  	  			alert("请输入公告标题");
  	  			return false;
  			}
  			
  			tmp = document.getElementById("ann_begin_time").value;
  			tmp = jQuery.trim(tmp);
  			if(tmp == "") {
  	  			alert("请选择开始时间");
  	  			return false;
  			}
  			
  			tmp = document.getElementById("ann_end_time").value;
  			tmp = jQuery.trim(tmp);
  			if(tmp == "") {
  	  			alert("请选择结束时间");
  	  			return false;
  			}
  			
  			//状态
  			tmp = "-1";
  			if(document.getElementById("ann_state_1").checked == true) {
  				tmp = "1";
  			} else if (document.getElementById("ann_state_0").checked == true) {
  				tmp = "0";
  			} else { //应该不会出现这种情况
  				alert("请选择公告状态");
  	  			return false;
  			}
  			document.getElementById("ann_state").value = tmp;
  			
  			return true;
  			
  		}
	</SCRIPT>
	</body>
</html>
